package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Author WEN
 * @Date 2023/11/1 0001
 **/
@Data
@ApiModel("客户登录对象")
public class UserLoginVo {
    @NotNull(message = "登录类型不能为空")
    @NumberPattern(regexp = "^(1|2)$", message = "登录类型参数不合法")
    @ApiModelProperty(value = "登录类型：1-验证码登录，2-账号密码登录", required = true, example = "1")
    private Integer type;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "手机号格式错误")
    @ApiModelProperty(value = "手机号", required = true)
    private String phone;

    @ApiModelProperty(value = "账号是否注册并登录，true-注册并登录，false-仅登录（已注册）", example = "false")
    private boolean accountRegistLogin = false;

    @ApiModelProperty(value = "登录密码")
    private String password;

    @ApiModelProperty(value = "验证码")
    private String code;


}
